#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>

//arr1是原数组 arr2是待判断的数组
int findround1(char* arr1, char* arr2)
{
	int len = strlen(arr1);
	for (int i = 0;i < len;i++)
	{
		int j = 0;
		char temp = arr1[0];
		for (;j < len - 1;j++)
		{
			arr1[j] = arr1[j + 1];
		}
		arr1[j] = temp;
		if (strcmp(arr1, arr2) == 0)
		{
			return 1;
		}
	}
	return 0;
}

int findround2(char* arr1, char* arr2)
{
	char temp[256] = { 0 };
	strcpy(temp, arr1);
	strcat(temp, arr1);
	return strstr(temp, arr2) != NULL;
}

int main()
{
	char arr1[] = "abbcde";
	char arr2[] = "bbcdea";
	//int ret = findround1(arr1, arr2);
	int ret = findround2(arr1, arr2);
	if (ret == 1)
	{
		printf("是左旋得到的!\n");
	}
	else
	{
		printf("不是左旋得到的!\n");
	}
}